﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebCliente.UserControls
{
    public partial class ucMiscelaneos : System.Web.UI.UserControl
    {

        #region Propiedades

        public bool propertyResideEnPanama
        {
            set { this.trResidePanama.Visible = value; }
        }

        
        public bool propertyClienteBanesco
        {
            set { trClienteBanesco.Visible = value; }
        }

        public bool propertyEmail
        {
            set { trEmail.Visible = value; }
        }

        public String Email
        {
            get { return txtEmail.Text; }
            set { txtEmail.Text = value; }
        }

        public String LabelEmail
        {
            set { lblEmail.Text = value; }
        }


        public String ClienteEnOtroPais
        {
            get { return rblClienteOtroPais.SelectedValue; }
            set { rblClienteOtroPais.SelectedValue = value; }
        }

        public String ClientePais
        {
            get { return ddlPais.SelectedValue.Trim(); }
            set { ddlPais.SelectedValue = value; }
        }

        public bool DeshabilitarEmail
        {
            set { this.txtEmail.Enabled = value; }
        }

        #endregion

        public Boolean HabilitarTodosValidators
        {
            set { HabilitarTodosValidatorsDatosAdicionales(value); }
        }

        protected void HabilitarTodosValidatorsDatosAdicionales(Boolean valor)
        {
            RequiredFieldValidator1.Visible = valor;
            RequiredFieldValidator2.Visible = valor;
            RequiredFieldValidator3.Visible = valor;
            RequiredFieldValidator4.Visible = valor;
            RegularExpressionValidator1.Visible = valor;

            RequiredFieldValidator1.Enabled = valor;
            RequiredFieldValidator2.Enabled = valor;
            RequiredFieldValidator3.Enabled = valor;
            RequiredFieldValidator4.Enabled = valor;
            RegularExpressionValidator1.Enabled = valor;
            
        }

        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void rblClienteOtroPais_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (rblClienteOtroPais.SelectedValue == "S")
            {
                trClienteEnOtroPais.Visible = true;
            }
            else
            {
                trClienteEnOtroPais.Visible = false;
            }
        }

    }
}